<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>盒模型-外边距</title>
  <style>
    div {
      width: 400px;
      height: 200px;
      background-color: #0f0;
      /* 外边距 */
      /* margin: 20px; */
      /* margin-left: 20px; */
      /* 版心居中 */
      margin: 0 auto;
    }
  </style>
</head>

<body>
  <!-- 外边距不会改变div宽高 -->
  <div></div>
</body>

</html>